-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLVM]Fix symbol visibility macros not being define for AIX #107705
Conversation
@llvm/pr-subscribers-llvm-support Author: Thomas Fransham (fsfod) ChangesThis is to try and fix buildbot failure on clang-ppc64-aix from my changes in #96630. I don't really know much about AIX so it would be good to have someone more knowledgeable to say if visibility macros on extern templates is needed on AIX similar to ELF. @compnerd @tstellar Full diff: https://github.com/llvm/llvm-project/pull/107705.diff 1 Files Affected:
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index 140ff611af79fb..1d2d751d4dc11a 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -189,7 +189,7 @@
#define LLVM_TEMPLATE_ABI __declspec(dllimport)
#define LLVM_EXPORT_TEMPLATE
#endif
-#elif defined(__ELF__) || defined(__MINGW32__)
+#elif defined(__ELF__) || defined(__MINGW32__) || defined(_AIX)
#define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
#define LLVM_TEMPLATE_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
#define LLVM_EXPORT_TEMPLATE
|
…ty annotations These are my initial build and code changes to supporting building llvm as shared library/DLL on windows(without force exporting all symbols) and making symbol visibility hidden by default on Linux which adding explicit symbol visibility macros to the whole llvm codebase. Updated cmake code to allow building llvm-shlib on windows by appending /WHOLEARCHIVE:lib to the linker options. Remove the hardcoded CMake error from using LLVM_BUILD_LLVM_DYLIB on windows. Updated CMake to define new macros to control conditional export macros in llvm/Support/Compiler.h Use /Zc:dllexportInlines- when compiling with clang-cl on windows with a opt out CMake option to disable using it. Replace some use of LLVM_EXTERNAL_VISIBILITY with new export macros. Some of the cmake and code changes are based on @tstellar's earlier PR #67502. I have Windows building using clang-cl, while for MSVC its at-least able to build libllvm, but some tests can't build because llvm iterator template metaprogramming that doesn't work well with dllexport. Linux should build without issue. My full branch is here https://github.com/fsfod/llvm-project/tree/llvm-export-api-20.0 and including all the auto generated export macros from clang tooling based system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on AIX. LGTM, thanks!
I don't have commit access if you want to merge it for me. |
) This is to try and fix buildbot failure on [clang-ppc64-aix](https://lab.llvm.org/buildbot/#/builders/64/builds/881) from my changes in llvm#96630. I don't really know much about AIX so it would be good to have someone more knowledgeable to say if visibility macros on extern templates is needed on AIX similar to ELF. @compnerd @tstellar
This is to try and fix buildbot failure on clang-ppc64-aix from my changes in #96630. I don't really know much about AIX so it would be good to have someone more knowledgeable to say if visibility macros on extern templates is needed on AIX similar to ELF. @compnerd @tstellar